package com.example.demo.repository;

import com.example.demo.entity.BookEntity;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * @author Haibin Yuan
 */
@Repository
public interface BookRepository extends JpaRepository<BookEntity, Long> {

    /**
     * Find all books written by author.
     *
     * @param author book author
     * @return books written by the author
     */
    List<BookEntity> findAllByAuthor(String author);

}
